package call

//annotation:user-service
//author:{"name":"user","tel":"18928776452","email":"XUnion@GMail.com"}

import (
	"encoding/json"
	"fmt"
	"net/http"
	"sevlteServer/auto"
	"sevlteServer/tool"
)

func Enroll(author string) {
	var developer *tool.ModuleAuthor
	if author != "" {
		var d tool.ModuleAuthor
		err := json.Unmarshal([]byte(author), &d)
		if err != nil {
			fmt.Println(err.Error())
			return
		}
		developer = &d
	}
	auto.AddService(&tool.ServeEndPoint{
		Fn: Recall,

		Path: "/call",
		Name: "call",

		Developer: developer,
	})

	//auto.AddService(&tool.ServeEndPoint{})
}

func Recall(r *http.Request, response http.ResponseWriter) {
	response.Write([]byte("hello"))
}
